package com.netdisk.controller;

import com.netdisk.dto.LoadAllFileDto;
import com.netdisk.service.FileService;
import com.netdisk.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Component
@RequestMapping("/file")
public class FileController {

    @Autowired
    private FileService fileService;

    @GetMapping("/loadAllFile")
    public Result<List<LoadAllFileDto>> loadAllFile(@RequestParam("folderId") Integer folderId) {
        return fileService.loadAllFile(folderId);
    }
    @GetMapping("test")
    public Result test() {
        return Result.success();
    }
}
